package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StoreGrouponSettingsMapper;
import com.ruoyi.system.domain.StoreGrouponSettings;
import com.ruoyi.system.service.IStoreGrouponSettingsService;

/**
 * 门店团购设置Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@Service
public class StoreGrouponSettingsServiceImpl implements IStoreGrouponSettingsService
{
    @Autowired
    private StoreGrouponSettingsMapper storeGrouponSettingsMapper;

    /**
     * 通过id查询门店团购设置
     *
     * @param id 门店团购设置主键
     * @return 门店团购设置
     */
    @Override
    public StoreGrouponSettings selectStoreGrouponSettingsById(Long id)
    {
        return storeGrouponSettingsMapper.selectStoreGrouponSettingsById(id);
    }

    /**
     * 查询门店团购设置列表
     *
     * @param storeName 门店名称
     * @return 门店团购设置
     */
    @Override
    public List<StoreGrouponSettings> selectStoreGrouponSettingsListByName(String storeName)
    {
        return storeGrouponSettingsMapper.selectStoreGrouponSettingsListByName(storeName);
    }

    /**
     * 新增门店团购设置列表
     *
     * @param storeGrouponSettings 门店团购设置
     * @return 结果
     */
    @Override
    public int insertStoreGrouponSettings(StoreGrouponSettings storeGrouponSettings)
    {
        storeGrouponSettings.setCreateTime(DateUtils.getNowDate());
        return storeGrouponSettingsMapper.insertStoreGrouponSettings(storeGrouponSettings);
    }

    /**
     * 修改门店团购设置列表
     *
     * @param storeGrouponSettings 门店团购设置
     * @return 结果
     */
    @Override
    public int updateStoreGrouponSettings(StoreGrouponSettings storeGrouponSettings)
    {
        storeGrouponSettings.setUpdateTime(DateUtils.getNowDate());
        return storeGrouponSettingsMapper.updateStoreGrouponSettings(storeGrouponSettings);
    }

    /**
     * 批量删除门店团购设置列表
     *
     * @param ids 需要删除的门店团购设置主键
     * @return 结果
     */
    @Override
    public int deleteStoreGrouponSettingsByIds(Long[] ids)
    {
        return storeGrouponSettingsMapper.deleteStoreGrouponSettingsByIds(ids);
    }

    /**
     * 删除门店团购设置信息列表
     *
     * @param id 门店团购设置主键
     * @return 结果
     */
    @Override
    public int deleteStoreGrouponSettingsById(Long id)
    {
        return storeGrouponSettingsMapper.deleteStoreGrouponSettingsById(id);
    }
}
